<html>
<head><meta charset="utf-8"><title>SSR in comments · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SSR.20in.20comments.html">SSR in comments</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="238123426"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SSR%20in%20comments/near/238123426" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Maik Klein <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SSR.20in.20comments.html#238123426">(May 10 2021 at 11:19)</a>:</h4>
<div class="codehilite"><pre><span></span><code>// Place the cursor on the line below to see the assist 💡.
// foo($a, $b) ==&gt;&gt; ($a).foo($b)
</code></pre></div>
<p>The docs say I can put ssr in the comments, but I don't get any assist here. <br>
Neither in vim with coc nor vscode. Is this still supported. Do I need to enable it somewhere?</p>



<a name="238123759"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SSR%20in%20comments/near/238123759" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SSR.20in.20comments.html#238123759">(May 10 2021 at 11:22)</a>:</h4>
<p>it's supported, but if the SSR query doesn't work for some reason, it'll just not show the assist without explanation. In VSCode you can also use the SSR command, and I think it will give you at least an error message? I hope</p>



<a name="238123804"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SSR%20in%20comments/near/238123804" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SSR.20in.20comments.html#238123804">(May 10 2021 at 11:22)</a>:</h4>
<p>it would be cool if we could show a diagnostic for a comment-SSR query</p>



<a name="238123840"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SSR%20in%20comments/near/238123840" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Maik Klein <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SSR.20in.20comments.html#238123840">(May 10 2021 at 11:23)</a>:</h4>
<p>ah that might be it. I'll try with something that should work</p>



<a name="238125122"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SSR%20in%20comments/near/238125122" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Maik Klein <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SSR.20in.20comments.html#238125122">(May 10 2021 at 11:35)</a>:</h4>
<p>Okay this is more difficult than I thought :D. Are there more docs with examples for SSR?</p>



<a name="238125347"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SSR%20in%20comments/near/238125347" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Maik Klein <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SSR.20in.20comments.html#238125347">(May 10 2021 at 11:37)</a>:</h4>
<p>besides this I mean <a href="https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_ssr/src/lib.rs#L6">https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_ssr/src/lib.rs#L6</a> ?</p>



<a name="238129389"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SSR%20in%20comments/near/238129389" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SSR.20in.20comments.html#238129389">(May 10 2021 at 12:10)</a>:</h4>
<p>Maybe try <a href="https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_ssr/src/tests.rs">https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_ssr/src/tests.rs</a></p>



<a name="238129597"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SSR%20in%20comments/near/238129597" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Maik Klein <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SSR.20in.20comments.html#238129597">(May 10 2021 at 12:11)</a>:</h4>
<p>Also yes the hints work if the SSR query is valid</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>